// @ts-ignore
/* eslint-disable */
import request from "@/utils/http";

/** 查询全部组织机构 GET /api/organization */
export async function getAllOrganizations(options?: { [key: string]: any }) {
  return request<Api.Result1IEnumerable1OrganizationDto>("/api/organization", {
    method: "GET",
    ...(options || {}),
  });
}

/** 创建组织机构 POST /api/organization */
export async function createOrganization(
  body: Api.CreateOrganizationCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Guid>("/api/organization", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除组织机构 DELETE /api/organization */
export async function batchDeleteOrganization(
  body: Api.BatchDeleteOrganizationCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/organization", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改组织机构 PUT /api/organization/${param0} */
export async function updateOrganization(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.updateOrganizationParams,
  body: Api.UpdateOrganizationCommand,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/organization/${param0}`, {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}
